// 全局模块的api

import axios from 'axios'

// 便签
export interface NotesReq {
  taskName: string
  taskDesc: string
  taskStatus: number
  taskPriority: number
  taskEndDate: string
}
export interface NotesRes {
  currentPage?: number
  pageSize?: number
  totalPage?: number
  totalCount?: number
  list: NotesResItem[]
}
export interface NotesResItem {
  taskId?: string
  isFinish?: boolean
  taskName: string
  taskDesc: string
  taskStatus: number
  taskPriority: number
  taskEndDate: string
}
export interface NotesListSearch {
  taskId?: string
  taskName?: string
  taskDesc?: string
  taskStatus?: number
  taskPriority?: number
  taskEndDate?: string
}
export function editNotes(data: NotesReq) {
  return axios.post<NotesResItem>('produce/taskAdit', data)
}

export function delNotes(data: { taskId: string }) {
  return axios.post<object>('produce/taskDelete', data)
}

export function getNotesDetail(data: { taskId: string }) {
  return axios.post<NotesResItem>('produce/taskDetail', data)
}

export function getNotesAllList(data?: NotesListSearch) {
  return axios.post<NotesRes>('produce/taskList', data)
}

export function getNotesPageList(data: NotesListSearch) {
  return axios.post<NotesRes>('produce/taskPage', data)
}

export function getTaskCount(data: NotesListSearch) {
  return axios.post<number>('produce/taskCount', data)
}
